package com.slz3.business.module.afterSaleManagement.aftWorkOrder.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.afterSaleManagement.aftWorkOrder.domain.AftWorkOrder;
import com.slz3.business.module.afterSaleManagement.aftWorkOrder.domain.AftWorkOrderCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class AftWorkOrderResController extends AftWorkOrderResAtomic {

    public Mono<ServerResponse> add(ServerRequest req, AftWorkOrder aftWorkOrder) {
        if (AftWorkOrderResUnsafeValid.add(req, aftWorkOrder)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.add_$AftWorkOrderUpdateLock(req, aftWorkOrder);
        }
    }

    public Mono<ServerResponse> delete(ServerRequest req, AftWorkOrderCondition aftWorkOrderCondition) {
        if (AftWorkOrderResUnsafeValid.delete(req, aftWorkOrderCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.delete_$AftWorkOrderUpdateLock(req, aftWorkOrderCondition);
        }
    }

    public Mono<ServerResponse> modify(ServerRequest req, AftWorkOrder aftWorkOrder) {
        if (AftWorkOrderResUnsafeValid.modify(req, aftWorkOrder)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.modify_$AftWorkOrderUpdateLock(req, aftWorkOrder);
        }
    }

    public Mono<ServerResponse> list(ServerRequest req) {
        if (AftWorkOrderResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.list(req);
        }
    }

    public Mono<ServerResponse> info(ServerRequest req) {
//        return aftWorkOrderResAtomic.info_$AftWorkOrderUpdateLock(req);
        if (AftWorkOrderResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.info_$AftWorkOrderUpdateLock(req);
        }
    }

    public Mono<ServerResponse> choice(ServerRequest req) {
        if (AftWorkOrderResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.choice(req);
        }
    }

    public Mono<ServerResponse> auditSubmit(ServerRequest req, AftWorkOrderCondition aftWorkOrderCondition) {
        //
        if (AftWorkOrderResUnsafeValid.auditSubmit(req, aftWorkOrderCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditSubmit_$AftWorkOrderUpdateLock(req, aftWorkOrderCondition);
        }
    }

    public Mono<ServerResponse> audit(ServerRequest req, AftWorkOrderCondition aftWorkOrderCondition) {
        if (AftWorkOrderResUnsafeValid.audit(req, aftWorkOrderCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.audit_$AftWorkOrderUpdateLock(req, aftWorkOrderCondition);
        }
    }

    public Mono<ServerResponse> auditReject(ServerRequest req, AftWorkOrderCondition aftWorkOrderCondition) {
        if (AftWorkOrderResUnsafeValid.auditReject(req, aftWorkOrderCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditReject_$AftWorkOrderUpdateLock(req, aftWorkOrderCondition);
        }
    }

    public Mono<ServerResponse> usingEnable(ServerRequest req, AftWorkOrderCondition aftWorkOrderCondition) {
        if (AftWorkOrderResUnsafeValid.usingEnable(req, aftWorkOrderCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingEnable_$AftWorkOrderUpdateLock(req, aftWorkOrderCondition);
        }
    }

    public Mono<ServerResponse> usingDisable(ServerRequest req, AftWorkOrderCondition aftWorkOrderCondition) {
        if (AftWorkOrderResUnsafeValid.usingDisable(req, aftWorkOrderCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingDisable_$AftWorkOrderUpdateLock(req, aftWorkOrderCondition);
        }
    }

}
